#include "apue.h"
#include <limits.h>

#define BSZ 2000000

char buf[BSZ];

int main() {
    int i= 0, nw;
    set_fl(STDOUT_FILENO, O_NONBLOCK);

    for(i=0; i<BSZ; ++i) {
        buf[i]= 'A';
    }
    if ((nw= write(STDOUT_FILENO, buf, BSZ)) < 0)
        err_sys("write error");

    fprintf(stderr, "pipe length is %d(PIPE_BUF= %d).\n", nw, PIPE_BUF);

}
